POV-Ray : Newsgroups : povray.advanced-users : isosurface help : Re: isosurface help Server Time
30 Jul 2024 00:30:34 EDT (-0400)
  Re: isosurface help  
From: Christoph Hormann
Date: 1 Sep 2000 12:17:37
Message: <39AFD6EE.18DEFE73@schunter.etc.tu-bs.de>
Chris Huff wrote:
> 
> Just use functions to convert the cartesian coordinates to spherical
> coordinates. There are many examples of these functions out there, just
> guessing I would write:
> #declare R = function {sqrt(sqr(x) + sqr(y) + sqr(z))}
> #declare Phi = function {atan2(x, z)}
> #declare Theta = function {atan2(y, sqrt(sqr(x) + sqr(z)))}
> 
> I might have Phi an Theta backwards or going the wrong direction(or
> completely wrong, since I am going from memory), but this gives the
> general idea. Just feed these functions the xyz cartesian coordinates
> and use the result as the spherical coordinates.
> 

You made way to much thoughts about it :-)

There are already predefined functions in megapov:

	"R" = sqrt(x*x+y*y+z*z) 
	"TH" = atan2(x,z) 
	"PH" = atan2(sqrt(x*x + z*z ),y) 

Anyway my respect for you doing it from memory.

Christoph

--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.